package com.rcloud.stock.database;

import android.content.Context;

import androidx.room.Room;
import androidx.room.RoomDatabase;

@androidx.room.Database(entities = {History.class}, version = 1, exportSchema = false)
public abstract class Database extends RoomDatabase {
    private static Database INSTANCE;
    static synchronized Database getDatabase(Context context) {
        if (INSTANCE == null) {
            INSTANCE = Room.databaseBuilder(context.getApplicationContext(), Database.class, "novel_database")
                    .allowMainThreadQueries().build();
        }
        return INSTANCE;
    }
    public abstract HistoryDao getHistoryDao();
}
